package org.itheimma.springbootquickstart.controller;

import org.itheimma.springbootquickstart.mapepr.ModelMapper;
import org.itheimma.springbootquickstart.pojo.Models;
import org.itheimma.springbootquickstart.pojo.Result;
import org.itheimma.springbootquickstart.service.ipml.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/models")
public class ThreeDModelController {
    @Autowired
    private ModelService modelService;
    @PostMapping("/upload")
    public Result upload(String threeUrl, String uploadedBy){
        Models model = new Models();
        model.setThree_url(threeUrl);
        model.setUploaded_by(uploadedBy);
        //模型上传
        modelService.upload(model);
        return Result.success();
    }
    @PostMapping("/uploadImgId")
    public Result uploadImgId(String image_id,int threeId){
        modelService.uploadImgId(image_id,threeId);
        return Result.success();
    }
}
